package meihua.stopcarapp.presenter.contract;

import meihua.mylibrary.base.BaseModel;
import meihua.mylibrary.base.BasePresenter;
import meihua.stopcarapp.bean.result.UserResult;
import meihua.stopcarapp.ui.BaseView;
import rx.Observable;

/**
 * Name: LGZ
 * Time: 2017/5/6.
 * Dec:
 */

public class LoginContract {

    public interface Model extends BaseModel {
        //请求发送验证码
        Observable<String> sendCode(String phone);
        //登陆
        Observable<UserResult> login(String phone, String code);
    }

    public interface View extends BaseView {
        //服务器返回验证码进行校验
        void returnPhoneCode(String code);
        //登陆返回的数据
        void returnLogin(UserResult userEntity);
    }

    public abstract static class Presenter extends BasePresenter<View, Model> {
        //发起验证码请求
        public abstract void sendCodeRequest(String phone);
        //发起登陆请求
        public abstract void loginRequest(String phone, String code);
    }

}
